<template>
  <div class="warpc">
    <div class="top">
      <div class="icon icon2">
        <span @click="fungo()"><van-icon name="arrow-left" /></span>
      </div>

      <div>
        <span class="icon icon1"><van-icon name="share-o" /></span>

        <span class="icon icon1"> <van-icon name="star-o" /></span>
      </div>
    </div>
    <div class="setline"></div>
    <van-tabs v-model="active">
      <van-tab title="套餐1">
        <div class="setline1"></div>

        <div class="tcone">
          <div class="oneline">
            <van-icon name="shop-o" /><span>{{ objfood1.name }}</span>
          </div>
          <p class="title">{{ objfood1.name1 }}</p>
          <div class="fd">
            <div class="fdcont">
              <div><van-icon name="passed" /><span>免预约</span></div>
              <div><van-icon name="passed" /><span>随时退</span></div>
              <div><van-icon name="passed" /><span>过期自动退</span></div>
            </div>
            <div>半年销量{{ objfood1.num1 }}</div>
            <!-- <div></div> -->
          </div>
          <p class="coloror">立减5.00元， 每桌限用一张</p>
          <div class="swipe">
            <van-swipe :loop="false" :width="145">
              <van-swipe-item
                ><img :src="objfood1.img1" alt=""
              /></van-swipe-item>
              <van-swipe-item
                ><img :src="objfood1.img2" alt=""
              /></van-swipe-item>
              <van-swipe-item
                ><img :src="objfood1.img3" alt=""
              /></van-swipe-item>
              <van-swipe-item
                ><img :src="objfood1.img4" alt=""
              /></van-swipe-item>
            </van-swipe>
          </div>
          <div class="specific">
            <p class="title">{{ objfood1.title }}</p>
            <div class="page">
              <p>
                <span>{{ objfood1.class11 }}</span
                ><span class="tj">网友推荐TOP.5</span>
              </p>
              <p>
                <span>(1份)</span> <span>￥{{ objfood1.price11 }}</span>
              </p>
            </div>
            <div class="page">
              <p>
                .<span>{{ objfood1.class12 }}</span>
              </p>
              <p>
                <span>(1份)</span> <span>￥{{ objfood1.price12 }}</span>
              </p>
            </div>
          </div>
          <div class="linebox"></div>
          <div class="buyknow">
            <p class="titlebuy">购买须知</p>
            <p class="buytitle">有效期：</p>
            <p class="buycontent">
              <span>2022.9.30</span>至<span>2022.10.11</span>
            </p>
            <p class="buytitle">使用事件</p>
            <p class="buycontent"><span>11:00-21:00</span></p>
            <p class="buytitle">使用规则</p>
            <p class="buycontent"><span>店内无包间</span></p>
            <p class="buycontent"><span>发票问题询问商家</span></p>
            <div class="more" @click="fun()">
              查看更多<van-icon name="arrow-down" />
            </div>
            <div class="morecontent" ref="morecontent1">
              <p class="buycontent"><span>商家提供免费wiFi</span></p>
              <p class="buycontent"><span>堂食外带均可，可免费打包</span></p>
              <p class="buycontent">
                <span>团购用户不可同时享受商家其他优惠</span>
              </p>
              <p class="buycontent">
                <span>酒水饮料等问题，请致电商家咨询，以商家反馈为准</span>
              </p>
              <p class="buycontent">
                <span>如部分菜品因时令或其他不可抗因素导致无法提供.</span>
              </p>
              <p class="buycontent">
                <span>使用优惠券购买团单，有效期以优惠券规则为准</span>
              </p>
              <p class="buycontent">
                <span>无需预约，消费高峰期可能需要等位 价格和销量说明</span>
              </p>
            </div>
          </div>
        </div>
        <div class="linebox"></div>
        <div class="lastcontent">
          <p class="lasttitle">适用商户</p>
          <p class="lastname">自然觉醒</p>
          <div class="twopart">
            <div>
              <div class="laststart">
                <img
                  class="start"
                  src="chenkong/imgs/shopcenter/start.gif"
                  alt=""
                />
                <img
                  class="start"
                  src="chenkong/imgs/shopcenter/start.gif"
                  alt=""
                />
                <img
                  class="start"
                  src="chenkong/imgs/shopcenter/start.gif"
                  alt=""
                />
                <img
                  class="start"
                  src="chenkong/imgs/shopcenter/start.gif"
                  alt=""
                />
                <img
                  class="start"
                  src="chenkong/imgs/shopcenter/start.gif"
                  alt=""
                />
              </div>
              <p>休息中 11：00-22：00</p>
            </div>
            <div>
              <div class="phone"><van-icon name="phone-o" /></div>
            </div>
          </div>
          <div class="adress">
            <div>
              <van-icon name="location-o" /><span
                >碑林区信义巷与顺城南路东城段交叉口东北巷</span
              >
            </div>
            <van-icon name="arrow" />
          </div>
        </div>
      </van-tab>

      <van-tab title="套餐2">
        <div class="setline1"></div>

        <div class="tcone">
          <div class="oneline">
            <van-icon name="shop-o" /><span>{{ objfood1.name }}</span>
          </div>
          <p class="title">{{ objfood1.name1 }}</p>
          <div class="fd">
            <div class="fdcont">
              <div><van-icon name="passed" /><span>免预约</span></div>
              <div><van-icon name="passed" /><span>随时退</span></div>
              <div><van-icon name="passed" /><span>过期自动退</span></div>
            </div>
            <div>半年销量{{ objfood1.num2 }}</div>
            <!-- <div></div> -->
          </div>
          <p class="coloror">立减5.00元， 每桌限用一张</p>
          <div class="swipe">
            <van-swipe :loop="false" :width="145">
              <van-swipe-item
                ><img :src="objfood1.img1" alt=""
              /></van-swipe-item>
              <van-swipe-item
                ><img :src="objfood1.img2" alt=""
              /></van-swipe-item>
              <van-swipe-item
                ><img :src="objfood1.img3" alt=""
              /></van-swipe-item>
              <van-swipe-item
                ><img :src="objfood1.img4" alt=""
              /></van-swipe-item>
            </van-swipe>
          </div>
          <div class="specific">
            <p class="title">{{ objfood1.title2 }}</p>
            <div class="page">
              <p>
                <span>{{ objfood1.class21 }}</span
                ><span class="tj">网友推荐TOP.5</span>
              </p>
              <p>
                <span>(1份)</span> <span>￥{{ objfood1.price21 }}</span>
              </p>
            </div>
            <div class="page">
              <p>
                .<span>{{ objfood1.class22 }}</span>
              </p>
              <p>
                <span>(1份)</span> <span>￥{{ objfood1.price22 }}</span>
              </p>
            </div>
          </div>
          <div class="linebox"></div>
          <div class="buyknow">
            <p class="titlebuy">购买须知</p>
            <p class="buytitle">有效期：</p>
            <p class="buycontent">
              <span>2022.9.30</span>至<span>2022.10.11</span>
            </p>
            <p class="buytitle">使用事件</p>
            <p class="buycontent"><span>11:00-21:00</span></p>
            <p class="buytitle">使用规则</p>
            <p class="buycontent"><span>店内无包间</span></p>
            <p class="buycontent"><span>发票问题询问商家</span></p>
            <div class="more" @click="fun()">
              查看更多<van-icon name="arrow-down" />
            </div>
            <div class="morecontent" ref="morecontent1">
              <p class="buycontent"><span>商家提供免费wiFi</span></p>
              <p class="buycontent"><span>堂食外带均可，可免费打包</span></p>
              <p class="buycontent">
                <span>团购用户不可同时享受商家其他优惠</span>
              </p>
              <p class="buycontent">
                <span>酒水饮料等问题，请致电商家咨询，以商家反馈为准</span>
              </p>
              <p class="buycontent">
                <span>如部分菜品因时令或其他不可抗因素导致无法提供.</span>
              </p>
              <p class="buycontent">
                <span>使用优惠券购买团单，有效期以优惠券规则为准</span>
              </p>
              <p class="buycontent">
                <span>无需预约，消费高峰期可能需要等位 价格和销量说明</span>
              </p>
            </div>
          </div>
        </div>
        <div class="linebox"></div>
        <div class="lastcontent">
          <p class="lasttitle">适用商户</p>
          <p class="lastname">自然觉醒</p>
          <div class="twopart">
            <div>
              <div class="laststart">
                <img
                  class="start"
                  src="chenkong/imgs/shopcenter/start.gif"
                  alt=""
                />
                <img
                  class="start"
                  src="chenkong/imgs/shopcenter/start.gif"
                  alt=""
                />
                <img
                  class="start"
                  src="chenkong/imgs/shopcenter/start.gif"
                  alt=""
                />
                <img
                  class="start"
                  src="chenkong/imgs/shopcenter/start.gif"
                  alt=""
                />
                <img
                  class="start"
                  src="chenkong/imgs/shopcenter/start.gif"
                  alt=""
                />
              </div>
              <p>休息中 11：00-22：00</p>
            </div>
            <div>
              <div class="phone"><van-icon name="phone-o" /></div>
            </div>
          </div>
          <div class="adress">
            <div>
              <van-icon name="location-o" /><span
                >碑林区信义巷与顺城南路东城段交叉口东北巷</span
              >
            </div>
            <van-icon name="arrow" />
          </div>
        </div>
      </van-tab>
    </van-tabs>
    <div class="bottom"></div>
    <div class="warpcsetmal">
      <div class="warpc-bx">
        <div class="content">
          <div class="left">
            <div>
              ￥<span class="price">{{ objfood1.old1 }}</span>
              <span class="gray">￥{{ objfood1.old1 }}</span>
            </div>
          </div>
          <div class="right" @click="funbuy()">
            <span>￥{{ objfood1.newp1 }}抢购</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// import { findAllTui } from "../../../api/chenkong.js";

import axios from "axios";
import SetMeal from "@/components/chenkong/setmeal/SetMeal.vue";

export default {
  components: {
    SetMeal,
  },

  data() {
    return {
      active: "",
      obj: [],
      objpl: [],
      objfood1: [],
      num: 0,
    };
  },

  created() {
    let i = this.$route.query.shopid;
    this.num = i;
    console.log(this.num);
    // axios.request("http://localhost:8889/shoplistCK").then(({ data }) => {
    //   this.obj = data[i];
    // });
    // findAllTui({ storeid: 1 }).then((ok) => {
    //   console.log(ok.data.data[0]);
    //   this.objfood = ok.data.data[0];
    // });
    axios.request("http://localhost:8889/cktc").then(({ data }) => {
      // console.log(ok)
      this.objfood1 = data[i];
      console.log(this.objfood1.img1);
    });
  },
  mounted() {
    this.$nextTick(() => {
      this.$refs.morecontent1.style.display = "none";
    });
  },
  methods: {
    fun() {
      this.$nextTick(() => {
        this.$refs.morecontent1.style.display = "block";
      });
    },
    fungo() {
      this.$router.go(-1);
    },
    funbuy() {
      // this.$router.push("/BuyV");
      this.$router.push({ name: "BuyV", query: { buyid: this.num } });
    },
  },
};
</script>
<style >
.van-swipe__indicator {
  display: none;
}
.van-swipe-item {
  width: 34.4vw;
}
</style>
<style lang="scss" scoped>
.warpcsetmal {
  position: fixed;
  bottom: 0;
  background: #fff;
  width: 100%;
  border-top: 0.267vw solid #d8d8d8;
  .warpc-bx {
    width: 95%;
    margin: auto;

    .content {
      display: flex;
      justify-content: space-between;
      height: 14.4vw;
      line-height: 14.4vw;
      font-size: 2.667vw;

      .left {
        color: #ed7044;
        .price {
          text-decoration: line-through;
          font-size: 4.267vw;
          font-weight: bold;
        }
        .gray {
          color: gray;
          text-decoration: line-through;
        }
      }
      .right {
        margin-top: 2vw;
        width: 38.4vw;
        height: 10.133vw;
        background: #ed7044;
        text-align: center;
        line-height: 10.133vw;
        color: #fff;
        border-radius: 999rem;
      }
    }
  }
}
.warpc {
  margin-top: 5.333vw;
  width: 100%;

  ::v-deep .van-tab--active {
    color: #ee4636;
  }
  ::v-deep .van-tabs__line {
    height: 1.067vw;
    width: 22.933vw;
    border-radius: 0%;
    background: #ee4636;
  }
  .top {
    width: 95%;
    margin: auto;
    font-size: 3.733vw;
    display: flex;
    justify-content: space-between;
    line-height: 8.8vw;
    height: 8.8vw;

    .icon {
      font-size: 6.4vw;
      padding-left: 1.333vw;
    }
    .icon1 {
      padding-right: 3vw;
    }
  }
  .setline {
    width: 100%;
    height: 0.267vw;
    background: #f7f7f7;
  }
  .setline1 {
    width: 95%;
    margin: auto;
    height: 0.267vw;
    background: #f7f7f7;
  }
  .swipe {
    position: relative;
    // width: 90%;
    margin: auto;

    img {
      width: 37.333vw;
      height: 26.667vw;
      border: 0.267vw solid #f7f7f7;
    }
  }
  .linebox {
    width: 100%;
    height: 2.133vw;
    background: #f6f6f6;
  }
  .tcone {
    width: 95%;
    margin: auto;
    // background: green;
    // width: 3.2vw;
    font-size: 3.2vw;
    .oneline {
      padding: 3.733vw 0;
    }
    .title {
      font-size: 4.267vw;
      font-weight: bold;
    }
    .fd {
      display: flex;
      justify-content: space-between;
      padding: 1.867vw 0;
      .fdcont {
        display: flex;
        span {
          padding: 0 1.333vw;
        }
      }
    }
    .coloror {
      color: #ee4636;
      padding-bottom: 3.733vw;
    }
  }
  .specific {
    padding-bottom: 4vw;
    .title {
      font-size: 4.267vw;
      font-weight: bold;
      padding: 3.733vw 0;
    }
    .page {
      display: flex;
      justify-content: space-between;
      .tj {
        font-size: 2.667vw;
        color: #ee4636;
        padding: 0.267vw;
        border: 0.267vw solid #ee4636;
        margin-left: 2.667vw;
        line-height: 5.867vw;
      }
    }
  }
  .buyknow {
    .titlebuy {
      font-size: 4.267vw;
      font-weight: bold;
      line-height: 8.533vw;
    }
    .buytitle {
      color: #d8d8d8;
    }
    .buycontent {
      padding: 0.8vw 0 1.333vw 0.8vw;
    }
    .more {
      border-top: 0.267vw solid #d8d8d8;
      height: 12.8vw;
      text-align: center;
      line-height: 12.8vw;
      color: #d8d8d8;
    }
  }
  .lastcontent {
    width: 95%;
    margin: auto;
    .lasttitle {
      font-size: 4.267vw;
      font-weight: bold;
      line-height: 8.533vw;
    }
    .lastname {
      font-size: 3.733vw;
      font-weight: bold;
      // line-height: 8.533vw;
    }
    .twopart {
      display: flex;
      justify-content: space-between;
      padding-bottom: 3.2vw;
      border-bottom: 0.267vw solid #d8d8d8;
      .phone {
        width: 17.333vw;
        border-left: 0.267vw solid #d8d8d8;
        text-align: center;
        color: #ee4636;
      }
    }
    .adress {
      display: flex;
      justify-content: space-between;
      font-size: 3.733vw;
      padding: 3.733vw 0;
    }
    .laststart {
      padding: 2.667vw 0;
      img {
        width: 3.2vw;
      }
    }
  }
  .bottom {
    height: 14.4vw;
  }
}
</style>